<?php

namespace slinks\extensions\action\interceptor;

use slinks\extensions\action\core\IActionInvocation;

class ActionInvokingInterceptor implements IActionInterceptor {

    /**
     * Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the
     * request by the IActionInvocation or to short-circuit the processing and just return a String return code.
     *
     * @param IActionInvocation invocation the action invocation
     */
    public function intercept(IActionInvocation $invocation) {
        $invocation->setReturnValue($invocation->getActionProxy()->execute());
        $invocation->invoke();
    }

}